<%@ page import="com.onlineOrder.bean.indentList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 12296
  Date: 2022/3/15
  Time: 8:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>我的订单</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" >
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" >
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" ></script>
</head>
<body>
<div class="container row=10">
    <table class="table table-striped table-hover">
        <tbody>
            <tr>
                <th>     </th>
                <th>菜品名</th>
                <th>总金额</th>
                <th>供餐方</th>
                <th>手机号</th>
                <th>订餐时间</th>
                <th>收餐地址</th>
                <th>状态</th>
                <th>操作</th>
            </tr>

            <%
                List<indentList> indentLists = (List<indentList>) request.getAttribute("buyLists");
                int i=0;

//                int i=0;
                for (indentList indentList : indentLists) {
                    String state="未支付";
                    if (indentList.getState().equals("1")){
                        state="已支付";
                    }
//                for (indentList indentList : indentLists) {
            %>
            <tr>
                <td><%=++i%></td>
                <td><%=indentList.getMenus()%></td>
                <td><%=indentList.getAmount()%></td>
                <td><%=indentList.getShopName()%></td>
                <td><%=indentList.getPhone()%></td>
                <td><%=indentList.getTime()%></td>
                <td><%=indentList.getAddress()%></td>
                <td><%=state%></td>
                <td>
                    <form method="post" action="<%=request.getContextPath()%>/indentStateUpdate">
                    <input value="支付" type="submit">
                    <input value="<%=indentList.getNum()%>" name="indentID" type="text" style="display: none">
                    <input value="<%=indentList.getTime()%>" name="indentTime" type="text" style="display: none">
                </form></td>

            </tr>
            <%
                }
            %>

        </tbody>
    </table>
</div>
</body>
</html>
